<?php
/*
 * @Description    : 控制器抽象类
 * @Version        : 1.0.0
 * @Author         : QianLong
 * @Date           : 2019-11-07 22:41:07
 * @LastEditors    : QianLong
 * @LastEditTime   : 2024-05-09 17:58:12
 */

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://doc.hyperf.io
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
 */

namespace App\Controller;

use Hyperf\Di\Annotation\Inject;
use Psr\Container\ContainerInterface;
use Hyperf\HttpServer\Contract\RequestInterface;
use Qianlong\Validate\Validate;
use App\Kernel\Http\Response;
use App\Service\DataResource;
use App\Service\MpWeixin;
use App\Service\RateControl;
use App\Common\RedisCache;

abstract class AbstractController
{
    #[Inject]
    protected ContainerInterface $container;

    #[Inject]
    protected RequestInterface $request;

    #[Inject]
    protected RateControl $rateControl;

    #[Inject]
    protected Response $response;

    #[Inject]
    protected DataResource $dataResource;

    #[Inject]
    protected MpWeixin $mpWeixin;

    #[Inject]
    protected RedisCache $redisCache;

    protected function validate(Validate $validate)
    {
        return $validate->validate($this->request->all());
    }
}
